<?php if ( $check == 0  ){
	redirect( 'search-voucher' );
} ?>
<div class="pagetitle">
	<h1>Kích hoạt sử dụng mã code voucher thành công </h1>
</div>
<div class="maincontent">  
    <div class="contentinner content-dashboard">    
        <p>Kích hoạt thành công mã <span style="font-size: 20px;color: rgb(31, 31, 232);"><?php echo $code;?></span></p>
		 <input type="hidden" class="code_voucher" value="<?php echo $code;?>"/>
		 <button class="btn" id="xuat_bao_cao"><i class="iconsweets-shuffle"></i> Xuất báo cáo</button>
		 &nbsp&nbsp&nbsp
		 <a href="<?php echo $baseurl.'search-voucher'?>" class="btn"><i class="icon-plus"></i> Thêm mới</a>
    </div>
</div>

<div id="hideReport" style="display: none;"></div>

<style>
.hr{
    margin: 10px 0px;padding-bottom: 10px !important;width: 98% !important;float: left;text-align: left !important;font-size: 19px;border-bottom: 1px solid #fff;border-bottom: 1px solid #ececef;box-shadow: 0px 1px 0px #FFF;
}
</style>
<script>
    $(document).ready(function(){
        $('#xuat_bao_cao').on('click', function(){
    		var code_voucher = $('.code_voucher').val();
            $.ajax({
               type: "GET",
               url: baseUrl+'manage/campaign/export-1-voucher',
               data: ({code_voucher: code_voucher }),
               beforeSend: function(){
                    showPreload();
               },
               success: function(n){
                    $('#hideReport').html(n);
                    exportToExcel();
               }  
            });
        });
    });
</script>